﻿using FubarDev.FtpServer.AccountManagement;

namespace Hicap.QRCodeWarehouse.Processor.FtpServer
{
    public class CustomFtpUser : IFtpUser
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="CustomFtpUser"/> instance.
        /// </summary>
        /// <param name="name">The user name</param>
        public CustomFtpUser(string name)
        {
            Name = name;
        }

        /// <inheritdoc />
        public string Name { get; }

        /// <inheritdoc />
        public bool IsInGroup(string groupName)
        {
            // We claim that the user is in both the "user" group and in the
            // a group with the same name as the user name.
            return groupName == "user" || groupName == Name;
        }
    }
}